home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vegask1a / autoplay.frm next >
Text File  |  1999-02-28  |  8KB  |  275 lines

  1. VERSION 5.00
  2. Begin VB.Form autoplayform 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "AutoPlay Settings  (lazy day keno)"
  6.    ClientHeight    =   5205
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4065
  10.    ControlBox      =   0   'False
  11.    BeginProperty Font 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   700
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   5205
  24.    ScaleWidth      =   4065
  25.    ShowInTaskbar   =   0   'False
  26.    StartUpPosition =   2  'CenterScreen
  27.    Begin VB.CommandButton cancelbutton 
  28.       Cancel          =   -1  'True
  29.       Caption         =   "&Cancel"
  30.       Height          =   375
  31.       Left            =   2280
  32.       TabIndex        =   11
  33.       Top             =   4560
  34.       Width           =   1095
  35.    End
  36.    Begin VB.CommandButton gobutton 
  37.       Caption         =   "GO"
  38.       Default         =   -1  'True
  39.       Height          =   375
  40.       Left            =   720
  41.       TabIndex        =   10
  42.       Top             =   4560
  43.       Width           =   1095
  44.    End
  45.    Begin VB.TextBox bettext 
  46.       Alignment       =   1  'Right Justify
  47.       BeginProperty Font 
  48.          Name            =   "MS Sans Serif"
  49.          Size            =   9.75
  50.          Charset         =   0
  51.          Weight          =   700
  52.          Underline       =   0   'False
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       Height          =   345
  57.       Left            =   2280
  58.       TabIndex        =   8
  59.       ToolTipText     =   "Enter Amount of Bet."
  60.       Top             =   3360
  61.       Width           =   495
  62.    End
  63.    Begin VB.TextBox repeattext 
  64.       Alignment       =   1  'Right Justify
  65.       BeginProperty Font 
  66.          Name            =   "MS Sans Serif"
  67.          Size            =   9.75
  68.          Charset         =   0
  69.          Weight          =   700
  70.          Underline       =   0   'False
  71.          Italic          =   0   'False
  72.          Strikethrough   =   0   'False
  73.       EndProperty
  74.       Height          =   360
  75.       Left            =   2280
  76.       TabIndex        =   0
  77.       ToolTipText     =   "Enter Number of Deals"
  78.       Top             =   2760
  79.       Width           =   1455
  80.    End
  81.    Begin VB.Label Label4 
  82.       BackStyle       =   0  'Transparent
  83.       Caption         =   "Enter Amount to bet."
  84.       ForeColor       =   &H00FFFFFF&
  85.       Height          =   495
  86.       Left            =   360
  87.       TabIndex        =   9
  88.       Top             =   3360
  89.       Width           =   2055
  90.    End
  91.    Begin VB.Label with1bet 
  92.       Alignment       =   2  'Center
  93.       AutoSize        =   -1  'True
  94.       BackColor       =   &H00000000&
  95.       Caption         =   "Label6"
  96.       ForeColor       =   &H00FFFFFF&
  97.       Height          =   195
  98.       Left            =   1740
  99.       TabIndex        =   7
  100.       Top             =   960
  101.       Width           =   585
  102.    End
  103.    Begin VB.Label with2bet 
  104.       Alignment       =   2  'Center
  105.       AutoSize        =   -1  'True
  106.       BackColor       =   &H00000000&
  107.       Caption         =   "Label5"
  108.       ForeColor       =   &H00FFFFFF&
  109.       Height          =   195
  110.       Left            =   1740
  111.       TabIndex        =   6
  112.       Top             =   1320
  113.       Width           =   585
  114.    End
  115.    Begin VB.Label with3bet 
  116.       Alignment       =   2  'Center
  117.       AutoSize        =   -1  'True
  118.       BackColor       =   &H00000000&
  119.       Caption         =   "Label4"
  120.       ForeColor       =   &H00FFFFFF&
  121.       Height          =   195
  122.       Left            =   1740
  123.       TabIndex        =   5
  124.       Top             =   1680
  125.       Width           =   585
  126.    End
  127.    Begin VB.Label with4bet 
  128.       Alignment       =   2  'Center
  129.       AutoSize        =   -1  'True
  130.       BackColor       =   &H00000000&
  131.       Caption         =   "Label4"
  132.       ForeColor       =   &H00FFFFFF&
  133.       Height          =   195
  134.       Left            =   1740
  135.       TabIndex        =   4
  136.       Top             =   2040
  137.       Width           =   585
  138.    End
  139.    Begin VB.Label Label3 
  140.       Alignment       =   2  'Center
  141.       BackStyle       =   0  'Transparent
  142.       Caption         =   "Autoplay will not accept settings that exceed your current amount of credits."
  143.       ForeColor       =   &H00FFFFFF&
  144.       Height          =   495
  145.       Left            =   120
  146.       TabIndex        =   3
  147.       Top             =   360
  148.       Width           =   3735
  149.    End
  150.    Begin VB.Label Label2 
  151.       Alignment       =   2  'Center
  152.       BackStyle       =   0  'Transparent
  153.       Caption         =   " "
  154.       BeginProperty Font 
  155.          Name            =   "MS Sans Serif"
  156.          Size            =   9.75
  157.          Charset         =   0
  158.          Weight          =   700
  159.          Underline       =   0   'False
  160.          Italic          =   0   'False
  161.          Strikethrough   =   0   'False
  162.       EndProperty
  163.       ForeColor       =   &H00FFFFFF&
  164.       Height          =   375
  165.       Left            =   240
  166.       TabIndex        =   2
  167.       Top             =   120
  168.       Width           =   3495
  169.    End
  170.    Begin VB.Label Label1 
  171.       BackStyle       =   0  'Transparent
  172.       Caption         =   "Enter the number of times to repeat."
  173.       ForeColor       =   &H00FFFFFF&
  174.       Height          =   495
  175.       Left            =   360
  176.       TabIndex        =   1
  177.       Top             =   2760
  178.       Width           =   2055
  179.    End
  180. End
  181. Attribute VB_Name = "autoplayform"
  182. Attribute VB_GlobalNameSpace = False
  183. Attribute VB_Creatable = False
  184. Attribute VB_PredeclaredId = True
  185. Attribute VB_Exposed = False
  186. Private Sub cancelbutton_Click()
  187. board.Enabled = True
  188. options.Enabled = True
  189. Unload Me
  190. End Sub
  191.  
  192. Private Sub form_load()
  193. bettext.Text = "0"
  194. repeattext.Text = "0"
  195. options.Enabled = False
  196. board.Enabled = False
  197. Label2.Caption = "You have " & dollars & " credits."
  198. with1bet.Caption = "You can play " & (dollars / 1) & " times with one bet."
  199. If dollars >= 2 Then
  200. with2bet.Caption = "You can play " & Format(((dollars / 2) - 1), "###,###") & " times with two bet."
  201. Else
  202. with2bet.Caption = "You can play " & Format((dollars / 2), "###,###") & " times with two bet."
  203. End If
  204. If dollars >= 3 Then
  205. with3bet.Caption = "You can play " & Format(((dollars / 3) - 1), "###,###") & " times with three bet."
  206. Else
  207. with3bet.Caption = "You can play " & Format((dollars / 3), "###,###") & " times with three bet."
  208. End If
  209. If dollars >= 4 Then
  210. with4bet.Caption = "You can play " & Format(((dollars / 4) - 1), "###,###") & " times with four bet."
  211. repeattext.Text = Format(((dollars / 4) - 1), "###,###")
  212. bettext.Text = "4"
  213. Else
  214. with4bet.Caption = "You can play " & Format((dollars / 4), "###,###") & " times with four bet."
  215. End If
  216.  
  217. End Sub
  218.  
  219. Private Sub gobutton_Click()
  220. On Error GoTo ErrHandler
  221. Dim startdollars As Double
  222. Dim enddollars As Double
  223. Dim x As Long
  224. Dim y As Long
  225. Dim f As Long
  226. Dim result As Double
  227. x = 0
  228. y = 0
  229. f = 0
  230. startdollars = 0
  231. enddollars = 0
  232. result = 0
  233. x = repeattext.Text
  234. y = bettext.Text
  235. f = (x * y)
  236. If f > dollars Or y > 4 Then
  237. MsgBox "This is not a Valid Setting, Please Re-enter", vbOKOnly
  238. repeattext.Text = ""
  239. bettext.Text = ""
  240. autoplayform.Refresh
  241. Exit Sub
  242. Else
  243. Me.Hide
  244. options.Hide
  245. board.Enabled = True
  246. options.Enabled = True
  247. startdollars = dollars
  248. autokenomode = 1
  249. board.change_button.Enabled = False
  250. Call board.autokeno(x, y)
  251. enddollars = dollars
  252. result = enddollars - startdollars
  253. If result = 0 Then
  254. MsgBox "You broke even!", vbApplicationModal, "Even Steven"
  255. ElseIf result > 0 Then
  256. MsgBox "Your Have Won " & Format(result, "###,###") & " Credits", vbOKOnly
  257. ElseIf result < 0 Then
  258. result = Abs(result)
  259. MsgBox "You Have Lost " & Format(result, "###,###") & " Credits",